package com.m3958.firstgwt.server.utils;

import java.util.List;

import com.m3958.firstgwt.server.model.Role;

public class CollectionFunc {
	public final static boolean roleNameInRoles(List<Role> roles,String roleName){
		for (Role role : roles) {
			if(role.getOrname().equals(roleName)){
				return true;
			}
		}
		return false;
	}
	
	public final static String[] arraySub(String[] strArray,String...subs){
		String[] ss = new String[strArray.length - subs.length];
		int i = 0;
		for(String s : strArray){
			boolean find = false;
			for(String sub : subs){
				if(s.equals(sub)){
					find = true;
					break;
				}
			}
			if(!find)ss[i++] = s;
		}
		return ss;
	}
}
